import { ref, computed, reactive } from 'vue'
import { defineStore } from 'pinia'
import { type ClientDto } from '@/api/ams'

export const useAmsStore = defineStore('ams', () => {
  // 实时通信中的当前客户端信息
  const currClient = reactive<ClientDto>({
    id: '',
    uniqueCode: '',
    assetCode: '',
    ip: '',
    activeMAC: '',
    biosSerial: '',
    mainBoardSerial: '',
    hardDiskSerial: '',
    hostname: '',
    createdAt: '',
    updatedAt: '',
    mapSimilarity: '',
    isOnline: false,
    lastMsgTime: ''
  })
  // 实时通信中的抽屉显示
  const chatDrawerShow = ref(false)

  // 日志详情的模态框
  const logDetailsDialog = ref(false)


  const count = ref(0)
  const doubleCount = computed(() => count.value * 2)
  function increment() {
    count.value++
  }

  return { count, doubleCount, increment, currClient, chatDrawerShow, logDetailsDialog }
})
